﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectDetails.aspx.cs" Inherits="Thksoft.ParameterSettings.ProjectDetails" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>项目详情设置</title>
    <link href="/CSS/Main.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .cont_list td {
            cursor: pointer;
        }
    </style>
</head>
<body>
    <script type="text/javascript">
        function ToReport(key, type, nameText) {
            document.getElementById("<%=this.FROM_KEY.ClientID %>").value = key;

            document.getElementById("<%=this.btnQuery.ClientID %>").click();
        }
        function BINGO(key) {
            document.getElementById("<%=this.FROM_DETAIL_KEY.ClientID %>").value = key;
            document.getElementById("<%=this.btnQuery1.ClientID %>").click();
        }
    </script>
    <form id="form1" runat="server">
        <asp:HiddenField runat="server" ID="FROM_KEY" />
        <asp:HiddenField runat="server" ID="FROM_DETAIL_KEY" />
        <!--隐藏的表单信息 -->
        <div class="main_show">
            <table id="tb_3" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width: 800px;">
                <tr style="width: 100%;">
                    <td style="border: 2px solid #6aa4d2; margin-top: 10px; min-height: 400px; overflow: hidden;">
                        <div style="width: 160px; float: left; padding-top: 10px; padding-left: 3px;">
                            <asp:TreeView ID="LEFT_THREE" runat="server" Width="160px">
                                <ParentNodeStyle Font-Bold="False" />
                                <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
                                <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
                                    VerticalPadding="0px" />
                                <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" HorizontalPadding="5px"
                                    NodeSpacing="0px" VerticalPadding="1px" />
                            </asp:TreeView>
                        </div>
                        <asp:Button ID="btnQuery" CssClass="hide" runat="server" Text="查询" OnClick="btnQuery_Click" />
                        <asp:Button ID="btnQuery1" CssClass="hide" runat="server" Text="查询" OnClick="btnQuery_Click1" />
                    </td>
                    <td valign="top">
                        <div style="width: 100%; float: left;">
                            <table border="0" cellpadding="0" cellspacing="0" class="table">
                                <tr>
                                    <td class="lefttd">详情名称：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="FORM_NAME" runat="server" CssClass="txt_input"></asp:TextBox>
                                        <font style="color: Red">*</font>
                                    </td>
                                    <td class="lefttd">详情编号：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="FORM_NUMBER" runat="server" CssClass="txt_input"></asp:TextBox>
                                        <font style="color: Red">*</font>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="lefttd">项目：
                                    </td>
                                    <td class="righttd">
                                        <asp:Label ID="FORM_PRO_NAME" runat="server"></asp:Label>
                                    </td>
                                    <td class="lefttd">项目编号：
                                    </td>
                                    <td class="righttd">
                                        <asp:Label ID="FORM_PRO_NUMBER" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4" style="text-align: center;">
                                        <asp:Button ID="btnInsert" CssClass="bt_css_s" runat="server" Text="新增" OnClick="btnInsert_Click" />
                                        &nbsp;
                                    <asp:Button ID="btnUpdate" CssClass="bt_css_s" runat="server" Text="修改" OnClick="btnUpdate_Click" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4" style="text-align: center;">
                                        <asp:GridView ID="GvProject" Width="99%" CssClass="cont_list" AutoGenerateColumns="False"
                                            AllowSorting="True" runat="server" OnRowDataBound="GvProject_RowDataBound" EmptyDataText="没有查找到您要的数据"
                                            OnSorting="GvProject_Sorting">
                                            <Columns>
                                                <asp:BoundField DataField="DETAILID" HeaderText="主键" SortExpression="DETAILID" />
                                                <asp:BoundField DataField="PRO_NUM" HeaderText="编号" SortExpression="PRO_NUM" />
                                                <asp:BoundField DataField="PRO_NAME" HeaderText="详情名称" SortExpression="PRO_NAME" />
                                                <asp:BoundField DataField="C_PRONAME" HeaderText="项目名称" SortExpression="C_PRONAME" />
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
    <script type="text/javascript">
        var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题
        var table = document.getElementById("tb_3");
        for (j = 0; j < table.rows[0].cells.length; j++) {
            table.rows[0].cells[j].onmousedown = function () {
                //记录单元格
                tTD = this;
                if (event.offsetX > tTD.offsetWidth - 10) {
                    tTD.mouseDown = true;
                    tTD.oldX = event.x;
                    tTD.oldWidth = tTD.offsetWidth;
                }
                //记录Table宽度
                //table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement;
                //tTD.tableWidth = table.offsetWidth;
            };
            table.rows[0].cells[j].onmouseup = function () {
                //结束宽度调整
                if (tTD == undefined) tTD = this;
                tTD.mouseDown = false;
                tTD.style.cursor = 'default';
            };
            table.rows[0].cells[j].onmousemove = function () {
                //更改鼠标样式
                if (event.offsetX > this.offsetWidth - 10)
                    this.style.cursor = 'col-resize';
                else
                    this.style.cursor = 'default';
                //取出暂存的Table Cell
                if (tTD == undefined) tTD = this;
                //调整宽度
                if (tTD.mouseDown != null && tTD.mouseDown == true) {
                    tTD.style.cursor = 'default';
                    if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
                        tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
                    //调整列宽
                    tTD.style.width = tTD.width;
                    tTD.style.cursor = 'col-resize';
                    //调整该列中的每个Cell
                    table = tTD;
                    while (table.tagName != 'TABLE') table = table.parentElement;
                    for (j = 0; j < table.rows.length; j++) {
                        table.rows[j].cells[tTD.cellIndex].width = tTD.width;
                    }
                    //调整整个表
                    //table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth);
                    //table.style.width = table.width;
                }
            };
        }
    </script>
</body>
</html>